import 'package:distribution_mall_flutter/generated/json/base/json_convert_content.dart';
import 'package:distribution_mall_flutter/entity/common/upload_file_entity.dart';

UploadFileBody $UploadFileBodyFromJson(Map<String, dynamic> json) {
  final UploadFileBody uploadFileBody = UploadFileBody();
  final String? fileId = jsonConvert.convert<String>(json['fileId']);
  if (fileId != null) {
    uploadFileBody.fileId = fileId;
  }
  final String? link = jsonConvert.convert<String>(json['link']);
  if (link != null) {
    uploadFileBody.link = link;
  }
  return uploadFileBody;
}

Map<String, dynamic> $UploadFileBodyToJson(UploadFileBody entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['fileId'] = entity.fileId;
  data['link'] = entity.link;
  return data;
}

extension UploadFileBodyExtension on UploadFileBody {
  UploadFileBody copyWith({
    String? fileId,
    String? link,
  }) {
    return UploadFileBody()
      ..fileId = fileId ?? this.fileId
      ..link = link ?? this.link;
  }
}